import axios from 'axios'
import axiosExtra from 'axios-extra'
const baseUrl = '/dev'

const http = axios.create({
    baseURL: baseUrl
})

const httpExtra = axiosExtra.create({
    maxConcurrent: 5, //并发为1
    queueOptions: {
        retry: 3, //请求失败时,最多会重试3次
        retryIsJump: false //是否立即重试, 否则将在请求队列尾部插入重试请求
    }
})

http.interceptors.response.use(response => {
    return response
})

const downLoadbyPiece = (identifier, config) => {
    return http.get(`/minio/tasks/downloadFile/${identifier}`,config)
}

export {
    downLoadbyPiece,
    httpExtra
}
